package cn.wolfcode.wms.mapper;

import cn.wolfcode.wms.domain.Department;
import cn.wolfcode.wms.domain.Permission;
import cn.wolfcode.wms.domain.Role;
import cn.wolfcode.wms.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    Integer queryForCount(QueryObject qo);

    List<Role> queryForPage(QueryObject qo);

    //添加外键关系
    void insertByRelation(@Param("roleId") Long roleId, @Param("pId") Long pId);

    //破坏外键关系
    void deleteByRelation(Long roleId);

    //添加外键关系:角色和菜单
    void insertByRelationOrMenu(@Param("roleId") Long roleId, @Param("menuId")Long menuId);

    //破坏外键关系:角色和菜单
    void deleteByRelationOrMenu(Long roleId);

}